/**这里存放支付成功后的订单详情数据 */
import { defineStore } from "pinia";
import { ref } from "vue";

export const useOrderInfoStore = defineStore("orderInfo", () => {
  //订单数据
  const orderInfo = ref<OrderDetailResponse>();

  //定义存储数据的方法
  const setOrderInfo = (orderInfoData: OrderDetailResponse) => {
    orderInfo.value = orderInfoData;
  };

  //定义获取数据的方法
  const getOrderInfo = () => {
    return orderInfo.value;
  };

  //导出数据
  return { orderInfo, setOrderInfo, getOrderInfo };
});
